package org.common.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "user")
@Data
@ToString(callSuper = true)
@DynamicInsert
@DynamicUpdate
@NoArgsConstructor
public class User extends BaseEntity implements Serializable {

    @Id
    @GenericGenerator(name = "uuidG", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuidG")
    @Column(name = "id", length = 50)
    private String id;

    /**
     * 姓名
     */
    @Column(name = "account", length = 50)
    private String name;

    /**
     * 密码
     */
    @Column(name = "password")
    private String password;

    /**
     * 邮箱
     */
    @Column(name = "email")
    private String email;

    /**
     * 禁用状态
     */
    @Column(name = "status")
    private boolean status = false;

    /**
     * 学习进度id
     */
    @Column(name = "study_progress_id")
    private String studyProgressId;

    /**
     * 头像id
     */
    @Column(name = "avatar_id", length = 1024)
    private String avatarId;

    /**
     * 角色id
     */
    @Column(name = "role_id")
    private String roleId;
}